const app = {
    state: {
        isCollapse: false,
        count:0
    },
    getters: {
        isCollapse: state => state.isCollapse,
        count: state => {
            return state.count
        },
    },
    actions: {
        toggleSidebar(context,e) {
            console.log(e);//接受的值
            context.commit('TOGGLE_SIDEBAR')
        },
        countAdd({commit}){
            commit('COUNT_ADD')
        },
        countDel({commit}){
            commit('COUNT_DEL')
        }
    },
    mutations: {
        // 折叠侧边栏
        TOGGLE_SIDEBAR(state) {
            state.isCollapse = !state.isCollapse
        },
        COUNT_ADD(state) {
            state.count++
        },
        COUNT_DEL(state) {
            state.count--
        }
    }
};

export default app
